<{extends "../Layout/default.html"}>
<{block name="main"}>
<div class="weui-toptips weui-toptips_warn"></div>
<{if $flag == 0}>
<{if $user.auth_status == 1}>
<div class="authresult-area bg-w">
    <i class="weui-icon-waiting weui-icon_msg"></i>
    <div class="text"><strong>审核中...</strong></div>
</div>
<{else if $user.auth_status == 2}>
<div class="authresult-area bg-w">
    <i class="weui-icon-success weui-icon_msg"></i>
    <div class="text"><strong>已认证</strong></div>
</div>
<{else if $user.auth_status == 3}>
<div class="authresult-area bg-w">
    <i class="weui-icon-success weui-icon_msg"></i>
    <div class="text"><strong>已拒绝</strong></div>
</div>
<{/if}>
<{/if}>
<div class="formpage">
    <{foreach $authinfo as $key => $row}>
    <section>
        <header class="weui-cells__title"><{if $key == 'base'}>基本信息<{else}>认证信息<{/if}></header>
        <div class="weui-cells">
            <{foreach $row as $k => $v}>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <div class="weui-label-6em"><{$v.item_name}>:</div>
                </div>
                <div class="weui-cell__bd">
                    <p><{$v.item_val}></p>
                </div>
            </div>
            <{/foreach}>
        </div>
    </section>
    <{/foreach}>
</div>
<{if $flag > 0}>
<div class="weui-btn-area">
    <a class="weui-btn weui-btn_primary <{if $user.auth_status != 1}>weui-btn_disabled<{/if}>" data-id="<{$userId}>" data-status="2" data-href="/audit/changeStatus">同意</a>
</div>
<div class="weui-btn-area">
    <a class="weui-btn weui-btn_default <{if $user.auth_status != 1}>weui-btn_disabled<{/if}>" data-id="<{$userId}>" data-status="3" data-href="/audit/changeStatus">拒绝</a>
</div>
<{/if}>

<script type="text/javascript" src="/js/jquery-3.1.0.min.js"></script>
<{if $user.auth_status == 1}>
<script>
    $(".weui-btn").one('click', function () {
        var href = $(this).data("href");
        var id = $(this).data("id");
        var status = $(this).data("status");
        $.post(href, {id: id, status: status}, function (output) {
            if (output.status == 1) {
                $(".weui-btn").addClass('weui-btn_disabled');
                showError("操作成功");
            } else {
                showError(output.msg);
            }
        });
        $(".weui-btn").off();
    })
</script>
<{/if}>
<{/block}>